﻿<%@ Page Title="" Language="C#" MasterPageFile="~/AuthoriztionMaster.master" AutoEventWireup="true"
    CodeBehind="editObject.aspx.cs" Inherits="Giaiphongmatbang.editObject" MaintainScrollPositionOnPostback="true" %>

<%@ Register Src="UserControl/ucSupportMove.ascx" TagName="ucSupportMove" TagPrefix="uc1" %>
<%@ Register Src="UserControl/ucSupportRent.ascx" TagName="ucSupportRent" TagPrefix="uc2" %>
<%@ Register Src="UserControl/ucSupportStabilize.ascx" TagName="ucSupportStabilize"
    TagPrefix="uc3" %>
<%@ Register Src="UserControl/ucSupportJob.ascx" TagName="ucSupportJob" TagPrefix="uc4" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="Style/duan.css" rel="stylesheet" type="text/css" />
    <link href="Style/jquery-ui-1.8.16.custom.css" rel="stylesheet" type="text/css" />
    <link href="Style/jquery.treeTable.css" rel="stylesheet" type="text/css" />
    <script src="/Scripts/jquery-ui-1.8.16.custom.min.js" type="text/javascript"></script>
    <script src="/Scripts/jquery.treeTable.js" type="text/javascript"></script>
    <script src="Scripts/jValidateInput.js" type="text/javascript"></script>
    <script type="text/javascript">
        function showdialog() {
            $('.dialogFormLand').dialog({
                modal: true,
                autoOpen: false,
                width: 520,
                close: function (event, ui) {
                    if (event.originalEvent && $(event.originalEvent.target).closest(".ui-dialog-titlebar-close").length) {
                        $("body").append("do some  stuff<br>");
                    }
                }
            });
            $(".dialogFormLand").parent().appendTo($("form:first"))
            $('.dialogFormLand').dialog('open');
            return false;
        }

        $(document).ready(function () {
            $('.dialogFormLand').dialog({
                modal: true,
                autoOpen: false,
                width: 520,
                close: function (event, ui) {
                    if (event.originalEvent && $(event.originalEvent.target).closest(".ui-dialog-titlebar-close").length) {
                        $("body").append("do some  stuff<br>");
                    }
                }
            });
        });

        function addland() {
            $('#<%=txtPlace.ClientID %>').val('');
            $('#<%=txtHamlet.ClientID %>').val('');
            $('#<%=txtPlot.ClientID %>').val('');
            $('#<%=txtofMap.ClientID %>').val('');
            $('#<%=txtPosition.ClientID %>').val('');
            $('#<%=txtOrigin.ClientID %>').val('');
            $('#<%=txtAreas.ClientID %>').val('');
            $('#<%=txtUserAreas.ClientID %>').val('');
            $('#<%=txtUnitPrice.ClientID %>').val('');

            $(".dialogFormLand").parent().appendTo($("form:first"))
            $('.dialogFormLand').dialog('open');
            return false;
        }

        function closeform() {
            $('.dialogFormLand').dialog("close");
            return false;
        }

        function check() {
            if ($('#<%=txtPlace.ClientID %>').val() == '' || $('#<%=txtPlace.ClientID %>').val() == null) {
                return false;
            }
            if ($('#<%=txtHamlet.ClientID %>').val() == '' || $('#<%=txtHamlet.ClientID %>').val() == null) {
                return false;
            }
            if ($('#<%=txtPosition.ClientID %>').val() == '' || $('#<%=txtPosition.ClientID %>').val() == null) {
                return false;
            }
            if ($('#<%=txtofMap.ClientID %>').val() == '' || $('#<%=txtofMap.ClientID %>').val() == null) {
                return false;
            }
            if ($('#<%=txtPlot.ClientID %>').val() == '' || $('#<%=txtPlot.ClientID %>').val() == null) {
                return false;
            }
            if ($('#<%=txtAreas.ClientID %>').val() == '' || $('#<%=txtAreas.ClientID %>').val() == null) {
                return false;
            }
            if ($('#<%=txtUnitPrice.ClientID %>').val() == '' || $('#<%=txtUnitPrice.ClientID %>').val() == null) {
                return false;
            }
            if ($('#<%=txtUserAreas.ClientID %>').val() == '' || $('#<%=txtUserAreas.ClientID %>').val() == null) {
                return false;
            }
            else {
                return;
            }
        }

        function keypress(e) {
            var keypressed = null;
            if (window.event) {
                keypressed = window.event.keyCode;
            }
            else {
                keypressed = e.which;
            }

            if (keypressed < 48 || keypressed > 57) {
                if (keypressed == 8 || keypressed == 127 || keypressed == null || keypressed == 0 || keypressed == 9 || keypressed == 13 || keypressed == 46) {
                    return;
                }

                return false;
            }
        }

        function AppliesValues() {
            var value = '';
            $('#tableLand tr:not(:first)').each(function () {
                var checkbox = $(this).find('input[name$=chk]');
                if (checkbox.attr('checked')) {
                    var ID = $(this).find('input[name$=hdf]').val();
                    var Areas = $(this).find('input[name$=txtAreas]').val();
                    var isSupport = $(this).find('input[name$=chkSupport]').attr('checked');
                    value += ID + "$--$" + Areas + "$--$" + isSupport + "|$--$|";
                }
            });
            $('#<%=hdfLand.ClientID %>').val(value);
            value = "";
            $('#tableTree tr:not(:first)').each(function () {
                var checkbox = $(this).find('input:checkbox');
                if (checkbox.attr('checked')) {
                    var ID = $(this).find('input[name$=hdf]').val();
                    var Quantity = $(this).find('input[name$=txtQuantity]').val();
                    value += ID + "$--$" + Quantity + "|$--$|";
                }
            });
            $('#<%=hdfTree.ClientID %>').val(value);
            value = "";
            $('#tableHouse tr:not(:first)').each(function () {
                var checkbox = $(this).find('input:checkbox');
                if (checkbox.attr('checked')) {
                    var ID = $(this).find('input[name$=hdf]').val();
                    var Quantity = $(this).find('input[name$=txtQuantity]').val();
                    value += ID + "$--$" + Quantity + "|$--$|";
                }
            });
            $('#<%=hdfHouse.ClientID %>').val(value);
            value = "";
            $('#tableBuilding tr:not(:first)').each(function () {
                var checkbox = $(this).find('input:checkbox');
                if (checkbox.attr('checked')) {
                    var ID = $(this).find('input[name$=hdf]').val();
                    var Quantity = $(this).find('input[name$=txtQuantity]').val();
                    var RemainingPercent = $(this).find('input[name$=txtRemainingPercent]').val();
                    value += ID + "$--$" + Quantity + "$--$" + RemainingPercent + "|$--$|";
                }
            });
            $('#<%=hdfBuilding.ClientID %>').val(value);
            value = "";
            $('#tableGrave tr:not(:first)').each(function () {
                var checkbox = $(this).find('input:checkbox');
                if (checkbox.attr('checked')) {
                    var ID = $(this).find('input[name$=hdf]').val();
                    var Quantity = $(this).find('input[name$=txtQuantity]').val();
                    value += ID + "$--$" + Quantity + "|$--$|";
                }
            });
            $('#<%=hdfGrave.ClientID %>').val(value);
            value = "";
            var count = 0;
            $('#treeMove tr:not(:first)').each(function () {
                var checkbox = $(this).find('input:checkbox');
                if (checkbox.attr('checked')) {
                    value = $(this).attr('id');
                    count++;
                }
            });
            if (count > 1) {
                alert('Chỉ được chọn một mục cho hỗ trợ này!'); return false;
            }
            $('#<%=hdfSupportMove.ClientID %>').val(value);
            value = "";
            count = 0;
            $('#treeRent tr:not(:first)').each(function () {
                var checkbox = $(this).find('input:checkbox');
                if (checkbox.attr('checked')) {
                    var ID = $(this).attr('id');
                    value = ID;
                    count++;
                }
            });
            if (count > 1) {
                alert('Chỉ được chọn một mục cho hỗ trợ này!'); return false;
            }
            $('#<%=hdfSupportRent.ClientID %>').val(value);
            value = "";
            count = 0;
            $('#treeStabilize tr:not(:first)').each(function () {
                var checkbox = $(this).find('input:checkbox');
                if (checkbox.attr('checked')) {
                    var ID = $(this).attr('id');
                    var Quantity = $(this).find('input:text').val();
                    value = ID + "$--$" + Quantity;
                    count++;
                }
            });
            if (count > 1) {
                alert('Chỉ được chọn một mục cho hỗ trợ này!'); return false;
            }
            $('#<%=hdfSupportStabilize.ClientID %>').val(value);
            value = "";
            count = 0;
            $('#treeJob tr:not(:first)').each(function () {
                var checkbox = $(this).find('input:checkbox');
                if (checkbox.attr('checked')) {
                    var ID = $(this).attr('id');
                    value = ID;
                    count++;
                }
            });
            if (count > 1) {
                alert('Chỉ được chọn một mục cho hỗ trợ này!'); return false;
            }
            $('#<%=hdfSupportJob.ClientID %>').val(value);
            value = "";
            $('#SupportOther p').each(function () {
                var SupportName = $(this).find('input[name=SupportName]').val();
                var Price = $(this).find('input[name=Price]').val();
                value += SupportName + "$--$" + Price + "|$--$|";
            });
            $('#<%=hdfSupportOther.ClientID %>').val(value);
            return confirm('Xác nhận hành động?');
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainContent" runat="server">
    <div style="background: #FFF">
        <div class="box-content">
            <p>
                <span>Tên dự án:</span>
                <asp:Literal ID="ltrProjectName" runat="server" />
            </p>
            <p>
                <span>Ban quản lý dự án:</span>
                <asp:Literal ID="ltrInvestor" runat="server" />
            </p>
        </div>
        <fieldset class="box-content">
            <legend><b>Thêm mới đối tượng</b></legend>
            <p>
                <span>Tên đối tượng:</span>
                <asp:TextBox ID="txtHouseHold" runat="server" CssClass="field" />
                <span class="required">(*)</span>
            </p>
            <p>
                <span>Giới tính:</span> <span>
                    <asp:DropDownList ID="drdGender" runat="server" CssClass="field">
                        <asp:ListItem Value="True">Nam</asp:ListItem>
                        <asp:ListItem Value="False">Nữ</asp:ListItem>
                    </asp:DropDownList>
                </span>
            </p>
            <p>
                <span>Điện thoại liên hệ</span>
                <asp:TextBox ID="txtPhoneNumber" runat="server" CssClass="field" onkeypress="return ValidateKeypress(event);"
                    MaxLength="11" />
            </p>
            <p>
                <span>Số nhân khẩu:</span>
                <asp:TextBox ID="txtMemberCount" runat="server" CssClass="field" onkeypress="return ValidateKeypress(event);"
                    MaxLength="2" />
            </p>
            <p>
                <span>Địa chỉ</span>
                <asp:TextBox ID="txtAddress" runat="server" CssClass="field" />
                <asp:DropDownList ID="drdVillage" runat="server" CssClass="field" />
                <asp:DropDownList ID="drdDistrict" runat="server" CssClass="field">
                    <asp:ListItem Value="1">Hưng nguyên</asp:ListItem>
                </asp:DropDownList>
                <asp:DropDownList ID="drdProvince" runat="server" CssClass="field">
                    <asp:ListItem Value="1">Nghệ An</asp:ListItem>
                </asp:DropDownList>
            </p>
            <p class="required">
                <span>&nbsp;</span> Lưu ý: Địa chỉ chỉ cần nhập Tiểu khu, Xóm, Thôn, Ấp,... (Ví
                dụ: Xóm 1, Tiểu khu 1)
            </p>
        </fieldset>
        <fieldset class="box-content">
            <legend><b>Danh sách các tài sản thiệt hại phải đền bù</b></legend>
            <asp:Panel ID="pnlLand" runat="server">
                <fieldset class="box-content">
                    <legend><b>Thiệt hại về đất</b></legend>
                    <asp:HiddenField ID="hdfLand" runat="server" />
                    <asp:Repeater ID="rpt_LandDamage" runat="server" OnItemCommand="rpt_LandDamage_ItemCommand">
                        <HeaderTemplate>
                            <table border="0" cellpadding="0" cellspacing="0" width="100%" class="table">
                                <tr>
                                    <th>
                                        TT
                                    </th>
                                    <th>
                                        Loại đất
                                    </th>
                                    <th>
                                        Số thửa
                                    </th>
                                    <th>
                                        Tờ bản đồ
                                    </th>
                                    <th>
                                        Vị trí
                                    </th>
                                    <th>
                                        Diện tích thu hồi
                                    </th>
                                    <th>
                                        Giá (đồng/m2)
                                    </th>
                                    <th style="width: 30px">
                                        Chọn
                                    </th>
                                </tr>
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tr>
                                <td>
                                    <%#Container.ItemIndex + 1 %>
                                </td>
                                <td>
                                    <%#Eval("LandName") %>
                                </td>
                                <td>
                                    <%#Eval("Plot") %>
                                </td>
                                <td>
                                    <%#Eval("ofMap") %>
                                </td>
                                <td>
                                    <%#Eval("Position") %>
                                </td>
                                <td>
                                    <%#Eval("Areas") %>
                                </td>
                                <td>
                                    <%#Eval("UnitPrice") %>
                                </td>
                                <td style="text-align: center">
                                    <asp:ImageButton ImageUrl="~/Images/delete.png" ID="ibtnDelete" runat="server" CommandArgument='<%#Eval("Index") %>'
                                        CommandName="ibtnDelete" />
                                </td>
                            </tr>
                        </ItemTemplate>
                        <FooterTemplate>
                            </table>
                        </FooterTemplate>
                    </asp:Repeater>
                    <div class="dialogFormLand" title="Cập nhật đền bù đất" style="display: none">
                        <table cellpadding="5" cellspacing="5">
                            <tr>
                                <td>
                                    Loại đất:
                                </td>
                                <td>
                                    <asp:DropDownList ID="ddlLandType" runat="server" CssClass="field" Width="362px">
                                    </asp:DropDownList>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Địa danh:
                                </td>
                                <td style="width: 250px;">
                                    <asp:TextBox ID="txtPlace" runat="server" CssClass="field" Width="350px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Khối - xóm:
                                </td>
                                <td>
                                    <asp:TextBox ID="txtHamlet" runat="server" CssClass="field" Width="350px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Thửa số:
                                </td>
                                <td style="width: 230px;">
                                    <asp:TextBox ID="txtPlot" runat="server" CssClass="field" Width="350px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Tờ bản đồ:
                                </td>
                                <td>
                                    <asp:TextBox ID="txtofMap" runat="server" CssClass="field" Width="350px" Onkeypress="return keypress(event);"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Vị trí:
                                </td>
                                <td>
                                    <asp:TextBox ID="txtPosition" runat="server" CssClass="field" Width="350px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Nguồn gốc đất:
                                </td>
                                <td>
                                    <asp:TextBox ID="txtOrigin" runat="server" CssClass="field" Width="350px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Diện tích:
                                </td>
                                <td>
                                    <asp:TextBox ID="txtAreas" runat="server" CssClass="field" Width="300px" Onkeypress="return keypress(event);"></asp:TextBox>
                                    (m2)
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Diện tích đang sử dụng:
                                </td>
                                <td>
                                    <asp:TextBox ID="txtUserAreas" runat="server" CssClass="field" Width="300px" Onkeypress="return keypress(event);"></asp:TextBox>
                                    (m2)
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Giá
                                </td>
                                <td>
                                    <asp:TextBox ID="txtUnitPrice" runat="server" CssClass="field" Width="300px" Onkeypress="return keypress(event);"></asp:TextBox>&nbsp;&nbsp;(đồng)
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    Ghi chú:
                                </td>
                                <td>
                                    <asp:TextBox ID="txtDescription" runat="server" CssClass="field" Width="350px"></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    &nbsp;
                                </td>
                                <td>
                                    <asp:Button ID="btnSave" OnClientClick="return check();" CssClass="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
                                        runat="server" Text="&nbsp;OK&nbsp;" OnClick="btnAddLand_Click" />
                                    <input type="button" id="btnCancel1" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
                                        value="Cancel" onclick="return closeform();" />
                                </td>
                            </tr>
                        </table>
                    </div>
                    <asp:Button ID="btnNewLand" runat="server" Text="Thêm mới" CssClass="button" OnClientClick="return addland()" /></p>
                </fieldset>
            </asp:Panel>
            <asp:UpdatePanel ID="UpadatePanel1" runat="server">
                <ContentTemplate>
                    <!--End pnlLand-->
                    <asp:Panel ID="pnlTree" runat="server">
                        <fieldset class="box-content">
                            <legend><b>Thiệt hại hoa màu</b></legend>
                            <asp:HiddenField ID="hdfTree" runat="server" />
                            <asp:Repeater ID="rptInsertTree" runat="server" OnItemDataBound="rptInsertTree_ItemDataBound">
                                <HeaderTemplate>
                                    <table border="0" cellpadding="0" cellspacing="0" width="100%" id="tableTree" class="table">
                                        <tr>
                                            <th>
                                                Loại hoa màu
                                            </th>
                                            <th width="80px">
                                                Đơn giá
                                            </th>
                                            <th width="120px">
                                                Đơn vị tính
                                            </th>
                                            <th>
                                                Số lượng
                                            </th>
                                            <th>
                                                &nbsp;
                                            </th>
                                        </tr>
                                </HeaderTemplate>
                                <FooterTemplate>
                                    </table></FooterTemplate>
                                <ItemTemplate>
                                    <tr>
                                        <td>
                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <asp:ImageButton ID="imgButton" runat="server" OnClick="imgButton1_Click" />
                                            <%#Eval("TreeName") %>
                                        </td>
                                        <td>
                                            <%#Eval("UnitPrice") %>
                                        </td>
                                        <td>
                                            <%#Eval("Unit") %>
                                        </td>
                                        <td width="160px">
                                            <asp:TextBox ID="txtQuantity" runat="server" CssClass="field" />
                                        </td>
                                        <td width="10px">
                                            <asp:CheckBox ID="chk" runat="server" />
                                            <asp:HiddenField ID="hdf" runat="server" Value='<%#Eval("TreeID") %>' />
                                            <asp:HiddenField ID="hdfexpand" runat="server" Value="true" />
                                        </td>
                                    </tr>
                                    <asp:Repeater ID="rptInsertTree" runat="server" OnItemDataBound="rptInsertTree_ItemDataBound">
                                        <ItemTemplate>
                                            <tr>
                                                <td>
                                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                    <asp:ImageButton ID="imgButton" runat="server" OnClick="imgButton1_Click" />
                                                    <%#Eval("TreeName") %>
                                                </td>
                                                <td>
                                                    <%#Eval("UnitPrice") %>
                                                </td>
                                                <td>
                                                    <%#Eval("Unit") %>
                                                </td>
                                                <td width="160px">
                                                    <asp:TextBox ID="txtQuantity" runat="server" CssClass="field" />
                                                </td>
                                                <td width="10px">
                                                    <asp:CheckBox ID="chk" runat="server" />
                                                    <asp:HiddenField ID="hdf" runat="server" Value='<%#Eval("TreeID") %>' />
                                                    <asp:HiddenField ID="hdfexpand" runat="server" Value="true" />
                                                </td>
                                            </tr>
                                            <asp:Repeater ID="rptInsertTree" runat="server" OnItemDataBound="rptInsertTree_ItemDataBound">
                                                <ItemTemplate>
                                                    <tr>
                                                        <td>
                                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                            <asp:ImageButton ID="imgButton" runat="server" OnClick="imgButton1_Click" />
                                                            <%#Eval("TreeName") %>
                                                        </td>
                                                        <td>
                                                            <%#Eval("UnitPrice") %>
                                                        </td>
                                                        <td>
                                                            <%#Eval("Unit") %>
                                                        </td>
                                                        <td width="160px">
                                                            <asp:TextBox ID="txtQuantity" runat="server" CssClass="field" />
                                                        </td>
                                                        <td width="10px">
                                                            <asp:CheckBox ID="chk" runat="server" />
                                                            <asp:HiddenField ID="hdf" runat="server" Value='<%#Eval("TreeID") %>' />
                                                            <asp:HiddenField ID="hdfexpand" runat="server" Value="true" />
                                                        </td>
                                                    </tr>
                                                    <asp:Repeater ID="rptInsertTree" runat="server" OnItemDataBound="rptInsertTree_ItemDataBound">
                                                        <ItemTemplate>
                                                            <tr>
                                                                <td>
                                                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                                    <asp:ImageButton ID="imgButton" runat="server" OnClick="imgButton1_Click" />
                                                                    <%#Eval("TreeName") %>
                                                                </td>
                                                                <td>
                                                                    <%#Eval("UnitPrice") %>
                                                                </td>
                                                                <td>
                                                                    <%#Eval("Unit") %>
                                                                </td>
                                                                <td width="160px">
                                                                    <asp:TextBox ID="txtQuantity" runat="server" CssClass="field" />
                                                                </td>
                                                                <td width="10px">
                                                                    <asp:CheckBox ID="chk" runat="server" />
                                                                    <asp:HiddenField ID="hdf" runat="server" Value='<%#Eval("TreeID") %>' />
                                                                    <asp:HiddenField ID="hdfexpand" runat="server" Value="true" />
                                                                </td>
                                                            </tr>
                                                            <asp:Repeater ID="rptInsertTree" runat="server" OnItemDataBound="rptInsertTree_ItemDataBound">
                                                                <ItemTemplate>
                                                                    <tr>
                                                                        <td>
                                                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                                            <asp:ImageButton ID="imgButton" runat="server" OnClick="imgButton1_Click" />
                                                                            <%#Eval("LandName") %>
                                                                        </td>
                                                                        <td>
                                                                            <%#Eval("UnitPrice") %>
                                                                        </td>
                                                                        <td>
                                                                            <%#Eval("Unit") %>
                                                                        </td>
                                                                        <td width="160px">
                                                                            <asp:TextBox ID="txtQuantity" runat="server" CssClass="field" />
                                                                        </td>
                                                                        <td width="10px">
                                                                            <asp:CheckBox ID="chk" runat="server" />
                                                                            <asp:HiddenField ID="hdf" runat="server" Value='<%#Eval("TreeID") %>' />
                                                                            <asp:HiddenField ID="hdfexpand" runat="server" Value="true" />
                                                                        </td>
                                                                    </tr>
                                                                </ItemTemplate>
                                                            </asp:Repeater>
                                                        </ItemTemplate>
                                                    </asp:Repeater>
                                                </ItemTemplate>
                                            </asp:Repeater>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </ItemTemplate>
                            </asp:Repeater>
                            <asp:Button ID="btnInsertTree" runat="server" ValidationGroup="1" Text="Thêm mới"
                                CssClass="button" OnClick="btnInsertTree_Click" />
                        </fieldset>
                    </asp:Panel>
                    <!--End pnlTree-->
                    <asp:Panel ID="pnlHouse" runat="server">
                        <fieldset class="box-content">
                            <legend><b>Thiệt hại nhà cửa</b></legend>
                            <asp:HiddenField ID="hdfHouse" runat="server" />
                            <asp:Repeater ID="rptInsertHouse" runat="server" OnItemDataBound="rptInsertHouse_ItemDataBound">
                                <HeaderTemplate>
                                    <table border="0" cellpadding="0" cellspacing="0" width="100%" id="tableHouse" class="table">
                                        <tr>
                                            <th>
                                                Loại nhà
                                            </th>
                                            <th width="80px">
                                                Đơn giá
                                            </th>
                                            <th width="120px">
                                                Đơn vị tính
                                            </th>
                                            <th>
                                                Số lượng
                                            </th>
                                            <th>
                                                &nbsp;
                                            </th>
                                        </tr>
                                </HeaderTemplate>
                                <FooterTemplate>
                                    </table></FooterTemplate>
                                <ItemTemplate>
                                    <tr>
                                        <td>
                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <asp:ImageButton ID="imgButton" runat="server" OnClick="imgButton2_Click" />
                                            <%#Eval("Type") %>
                                        </td>
                                        <td>
                                            <%#Eval("UnitPrice") %>
                                        </td>
                                        <td>
                                            <%#Eval("Unit") %>
                                        </td>
                                        <td width="160px">
                                            <asp:TextBox ID="txtQuantity" runat="server" CssClass="field" />
                                        </td>
                                        <td width="10px">
                                            <asp:CheckBox ID="chk" runat="server" />
                                            <asp:HiddenField ID="hdf" runat="server" Value='<%#Eval("HouseID") %>' />
                                            <asp:HiddenField ID="hdfexpand" runat="server" Value="true" />
                                        </td>
                                    </tr>
                                    <asp:Repeater ID="rptInsertHouse" runat="server" OnItemDataBound="rptInsertHouse_ItemDataBound">
                                        <ItemTemplate>
                                            <tr>
                                                <td>
                                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                    <asp:ImageButton ID="imgButton" runat="server" OnClick="imgButton2_Click" />
                                                    <%#Eval("Type") %>
                                                </td>
                                                <td>
                                                    <%#Eval("UnitPrice") %>
                                                </td>
                                                <td>
                                                    <%#Eval("Unit") %>
                                                </td>
                                                <td width="160px">
                                                    <asp:TextBox ID="txtQuantity" runat="server" CssClass="field" />
                                                </td>
                                                <td width="10px">
                                                    <asp:CheckBox ID="chk" runat="server" />
                                                    <asp:HiddenField ID="hdf" runat="server" Value='<%#Eval("HouseID") %>' />
                                                    <asp:HiddenField ID="hdfexpand" runat="server" Value="true" />
                                                </td>
                                            </tr>
                                            <asp:Repeater ID="rptInsertHouse" runat="server" OnItemDataBound="rptInsertHouse_ItemDataBound">
                                                <ItemTemplate>
                                                    <tr>
                                                        <td>
                                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                            <asp:ImageButton ID="imgButton" runat="server" OnClick="imgButton2_Click" />
                                                            <%#Eval("Type") %>
                                                        </td>
                                                        <td>
                                                            <%#Eval("UnitPrice") %>
                                                        </td>
                                                        <td>
                                                            <%#Eval("Unit") %>
                                                        </td>
                                                        <td width="160px">
                                                            <asp:TextBox ID="txtQuantity" runat="server" CssClass="field" />
                                                        </td>
                                                        <td width="10px">
                                                            <asp:CheckBox ID="chk" runat="server" />
                                                            <asp:HiddenField ID="hdf" runat="server" Value='<%#Eval("HouseID") %>' />
                                                            <asp:HiddenField ID="hdfexpand" runat="server" Value="true" />
                                                        </td>
                                                    </tr>
                                                    <asp:Repeater ID="rptInsertHouse" runat="server" OnItemDataBound="rptInsertHouse_ItemDataBound">
                                                        <ItemTemplate>
                                                            <tr>
                                                                <td>
                                                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                                    <asp:ImageButton ID="imgButton" runat="server" OnClick="imgButton2_Click" />
                                                                    <%#Eval("Type") %>
                                                                </td>
                                                                <td>
                                                                    <%#Eval("UnitPrice") %>
                                                                </td>
                                                                <td>
                                                                    <%#Eval("Unit") %>
                                                                </td>
                                                                <td width="160px">
                                                                    <asp:TextBox ID="txtQuantity" runat="server" CssClass="field" />
                                                                </td>
                                                                <td width="10px">
                                                                    <asp:CheckBox ID="chk" runat="server" />
                                                                    <asp:HiddenField ID="hdf" runat="server" Value='<%#Eval("HouseID") %>' />
                                                                    <asp:HiddenField ID="hdfexpand" runat="server" Value="true" />
                                                                </td>
                                                            </tr>
                                                            <asp:Repeater ID="rptInsertHouse" runat="server" OnItemDataBound="rptInsertHouse_ItemDataBound">
                                                                <ItemTemplate>
                                                                    <tr>
                                                                        <td>
                                                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                                            <asp:ImageButton ID="imgButton" runat="server" OnClick="imgButton2_Click" />
                                                                            <%#Eval("Type") %>
                                                                        </td>
                                                                        <td>
                                                                            <%#Eval("UnitPrice") %>
                                                                        </td>
                                                                        <td>
                                                                            <%#Eval("Unit") %>
                                                                        </td>
                                                                        <td width="160px">
                                                                            <asp:TextBox ID="txtQuantity" runat="server" CssClass="field" />
                                                                        </td>
                                                                        <td width="10px">
                                                                            <asp:CheckBox ID="chk" runat="server" />
                                                                            <asp:HiddenField ID="hdf" runat="server" Value='<%#Eval("HouseID") %>' />
                                                                            <asp:HiddenField ID="hdfexpand" runat="server" Value="true" />
                                                                        </td>
                                                                    </tr>
                                                                </ItemTemplate>
                                                            </asp:Repeater>
                                                        </ItemTemplate>
                                                    </asp:Repeater>
                                                </ItemTemplate>
                                            </asp:Repeater>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </ItemTemplate>
                            </asp:Repeater>
                            <asp:Button ID="btnInsertHouse" runat="server" ValidationGroup="1" Text="Thêm mới"
                                CssClass="button" OnClick="btnInsertHouse_Click" />
                        </fieldset>
                    </asp:Panel>
                    <!--End pnlHouse-->
                    <asp:Panel ID="pnlBuilding" runat="server">
                        <fieldset class="box-content">
                            <legend><b>Thiệt hại công trình khác</b></legend>
                            <asp:HiddenField ID="hdfBuilding" runat="server" />
                            <asp:Repeater ID="rptInsertBuilding" runat="server" OnItemDataBound="rptInsertBuilding_ItemDataBound">
                                <HeaderTemplate>
                                    <table border="0" cellpadding="0" cellspacing="0" width="100%" id="tableBuilding"
                                        class="table">
                                        <tr>
                                            <th>
                                                Loại công trình
                                            </th>
                                            <th width="80px">
                                                Đơn giá
                                            </th>
                                            <th width="120px">
                                                Đơn vị tính
                                            </th>
                                            <th width="160px">
                                                Số lượng
                                            </th>
                                            <th width="120px">
                                                Phần trăm còn lại
                                            </th>
                                            <th>
                                                &nbsp;
                                            </th>
                                        </tr>
                                </HeaderTemplate>
                                <FooterTemplate>
                                    </table></FooterTemplate>
                                <ItemTemplate>
                                    <tr>
                                        <td>
                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <asp:ImageButton ID="imgButton" runat="server" OnClick="imgButton3_Click" />
                                            <%#Eval("BuildingName") %>
                                        </td>
                                        <td>
                                            <%#Eval("UnitPrice") %>
                                        </td>
                                        <td>
                                            <%#Eval("Unit") %>
                                        </td>
                                        <td width="160px">
                                            <asp:TextBox ID="txtQuantity" runat="server" CssClass="field" />
                                        </td>
                                        <td>
                                            <asp:TextBox ID="txtRemainingPercent" runat="server" CssClass="field" />
                                        </td>
                                        <td width="10px">
                                            <asp:CheckBox ID="chk" runat="server" />
                                            <asp:HiddenField ID="hdf" runat="server" Value='<%#Eval("BuildingID") %>' />
                                            <asp:HiddenField ID="hdfexpand" runat="server" Value="true" />
                                        </td>
                                    </tr>
                                    <asp:Repeater ID="rptInsertBuilding" runat="server" OnItemDataBound="rptInsertBuilding_ItemDataBound">
                                        <ItemTemplate>
                                            <tr>
                                                <td>
                                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                    <asp:ImageButton ID="imgButton" runat="server" OnClick="imgButton3_Click" />
                                                    <%#Eval("BuildingName") %>
                                                </td>
                                                <td>
                                                    <%#Eval("UnitPrice") %>
                                                </td>
                                                <td>
                                                    <%#Eval("Unit") %>
                                                </td>
                                                <td width="160px">
                                                    <asp:TextBox ID="txtQuantity" runat="server" CssClass="field" />
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txtRemainingPercent" runat="server" CssClass="field" />
                                                </td>
                                                <td width="10px">
                                                    <asp:CheckBox ID="chk" runat="server" />
                                                    <asp:HiddenField ID="hdf" runat="server" Value='<%#Eval("BuildingID") %>' />
                                                    <asp:HiddenField ID="hdfexpand" runat="server" Value="true" />
                                                </td>
                                            </tr>
                                            <asp:Repeater ID="rptInsertBuilding" runat="server" OnItemDataBound="rptInsertBuilding_ItemDataBound">
                                                <ItemTemplate>
                                                    <tr>
                                                        <td>
                                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                            <asp:ImageButton ID="imgButton" runat="server" OnClick="imgButton3_Click" />
                                                            <%#Eval("BuildingName") %>
                                                        </td>
                                                        <td>
                                                            <%#Eval("UnitPrice") %>
                                                        </td>
                                                        <td>
                                                            <%#Eval("Unit") %>
                                                        </td>
                                                        <td width="160px">
                                                            <asp:TextBox ID="txtQuantity" runat="server" CssClass="field" />
                                                        </td>
                                                        <td>
                                                            <asp:TextBox ID="txtRemainingPercent" runat="server" CssClass="field" />
                                                        </td>
                                                        <td width="10px">
                                                            <asp:CheckBox ID="chk" runat="server" />
                                                            <asp:HiddenField ID="hdf" runat="server" Value='<%#Eval("BuildingID") %>' />
                                                            <asp:HiddenField ID="hdfexpand" runat="server" Value="true" />
                                                        </td>
                                                    </tr>
                                                    <asp:Repeater ID="rptInsertBuilding" runat="server" OnItemDataBound="rptInsertBuilding_ItemDataBound">
                                                        <ItemTemplate>
                                                            <tr>
                                                                <td>
                                                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                                    <asp:ImageButton ID="imgButton" runat="server" OnClick="imgButton3_Click" />
                                                                    <%#Eval("BuildingName") %>
                                                                </td>
                                                                <td>
                                                                    <%#Eval("UnitPrice") %>
                                                                </td>
                                                                <td>
                                                                    <%#Eval("Unit") %>
                                                                </td>
                                                                <td width="160px">
                                                                    <asp:TextBox ID="txtQuantity" runat="server" CssClass="field" />
                                                                </td>
                                                                <td>
                                                                    <asp:TextBox ID="txtRemainingPercent" runat="server" CssClass="field" />
                                                                </td>
                                                                <td width="10px">
                                                                    <asp:CheckBox ID="chk" runat="server" />
                                                                    <asp:HiddenField ID="hdf" runat="server" Value='<%#Eval("BuildingID") %>' />
                                                                    <asp:HiddenField ID="hdfexpand" runat="server" Value="true" />
                                                                </td>
                                                            </tr>
                                                            <asp:Repeater ID="rptInsertBuilding" runat="server" OnItemDataBound="rptInsertBuilding_ItemDataBound">
                                                                <ItemTemplate>
                                                                    <tr>
                                                                        <td>
                                                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                                            <asp:ImageButton ID="imgButton" runat="server" OnClick="imgButton3_Click" />
                                                                            <%#Eval("BuildingName") %>
                                                                        </td>
                                                                        <td>
                                                                            <%#Eval("UnitPrice") %>
                                                                        </td>
                                                                        <td>
                                                                            <%#Eval("Unit") %>
                                                                        </td>
                                                                        <td width="160px">
                                                                            <asp:TextBox ID="txtQuantity" runat="server" CssClass="field" />
                                                                        </td>
                                                                        <td>
                                                                            <asp:TextBox ID="txtRemainingPercent" runat="server" CssClass="field" />
                                                                        </td>
                                                                        <td width="10px">
                                                                            <asp:CheckBox ID="chk" runat="server" />
                                                                            <asp:HiddenField ID="hdf" runat="server" Value='<%#Eval("BuildingID") %>' />
                                                                            <asp:HiddenField ID="hdfexpand" runat="server" Value="true" />
                                                                        </td>
                                                                    </tr>
                                                                </ItemTemplate>
                                                            </asp:Repeater>
                                                        </ItemTemplate>
                                                    </asp:Repeater>
                                                </ItemTemplate>
                                            </asp:Repeater>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </ItemTemplate>
                            </asp:Repeater>
                            <asp:Button ID="btnInsertBuilding" runat="server" ValidationGroup="1" Text="Thêm mới"
                                CssClass="button" OnClick="btnInsertBuilding_Click" />
                        </fieldset>
                    </asp:Panel>
                    <!--End pnlBuilding-->
                    <asp:Panel ID="pnlGraves" runat="server">
                        <fieldset class="box-content">
                            <legend><b>Di chuyển mồ mả</b></legend>
                            <asp:HiddenField ID="hdfGrave" runat="server" />
                            <asp:Repeater ID="rptInsertGrave" runat="server" OnItemDataBound="rptInsertGrave_ItemDataBound">
                                <HeaderTemplate>
                                    <table border="0" cellpadding="0" cellspacing="0" width="100%" id="tableGrave" class="table">
                                        <tr>
                                            <th>
                                                Loại mồ mả
                                            </th>
                                            <th width="80px">
                                                Đơn giá
                                            </th>
                                            <th width="120px">
                                                Đơn vị tính
                                            </th>
                                            <th>
                                                Số lượng
                                            </th>
                                            <th>
                                                &nbsp;
                                            </th>
                                        </tr>
                                </HeaderTemplate>
                                <FooterTemplate>
                                    </table></FooterTemplate>
                                <ItemTemplate>
                                    <tr>
                                        <td>
                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                            <asp:ImageButton ID="imgButton" runat="server" OnClick="imgButton4_Click" />
                                            <%#Eval("GraveName") %>
                                        </td>
                                        <td>
                                            <%#Eval("UnitPrice") %>
                                        </td>
                                        <td>
                                            <%#Eval("Unit") %>
                                        </td>
                                        <td width="160px">
                                            <asp:TextBox ID="txtQuantity" runat="server" CssClass="field" />
                                        </td>
                                        <td width="10px">
                                            <asp:CheckBox ID="chk" runat="server" />
                                            <asp:HiddenField ID="hdf" runat="server" Value='<%#Eval("GraveID") %>' />
                                            <asp:HiddenField ID="hdfexpand" runat="server" Value="true" />
                                        </td>
                                    </tr>
                                    <asp:Repeater ID="rptInsertGrave" runat="server" OnItemDataBound="rptInsertGrave_ItemDataBound">
                                        <ItemTemplate>
                                            <tr>
                                                <td>
                                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                    <asp:ImageButton ID="imgButton" runat="server" OnClick="imgButton4_Click" />
                                                    <%#Eval("GraveName") %>
                                                </td>
                                                <td>
                                                    <%#Eval("UnitPrice") %>
                                                </td>
                                                <td>
                                                    <%#Eval("Unit") %>
                                                </td>
                                                <td width="160px">
                                                    <asp:TextBox ID="txtQuantity" runat="server" CssClass="field" />
                                                </td>
                                                <td width="10px">
                                                    <asp:CheckBox ID="chk" runat="server" />
                                                    <asp:HiddenField ID="hdf" runat="server" Value='<%#Eval("GraveID") %>' />
                                                    <asp:HiddenField ID="hdfexpand" runat="server" Value="true" />
                                                </td>
                                            </tr>
                                            <asp:Repeater ID="rptInsertGrave" runat="server" OnItemDataBound="rptInsertGrave_ItemDataBound">
                                                <ItemTemplate>
                                                    <tr>
                                                        <td>
                                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                            <asp:ImageButton ID="imgButton" runat="server" OnClick="imgButton4_Click" />
                                                            <%#Eval("GraveName") %>
                                                        </td>
                                                        <td>
                                                            <%#Eval("UnitPrice") %>
                                                        </td>
                                                        <td>
                                                            <%#Eval("Unit") %>
                                                        </td>
                                                        <td width="160px">
                                                            <asp:TextBox ID="txtQuantity" runat="server" CssClass="field" />
                                                        </td>
                                                        <td width="10px">
                                                            <asp:CheckBox ID="chk" runat="server" />
                                                            <asp:HiddenField ID="hdf" runat="server" Value='<%#Eval("GraveID") %>' />
                                                            <asp:HiddenField ID="hdfexpand" runat="server" Value="true" />
                                                        </td>
                                                    </tr>
                                                    <asp:Repeater ID="rptInsertGrave" runat="server" OnItemDataBound="rptInsertGrave_ItemDataBound">
                                                        <ItemTemplate>
                                                            <tr>
                                                                <td>
                                                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                                    <asp:ImageButton ID="imgButton" runat="server" OnClick="imgButton4_Click" />
                                                                    <%#Eval("GraveName") %>
                                                                </td>
                                                                <td>
                                                                    <%#Eval("UnitPrice") %>
                                                                </td>
                                                                <td>
                                                                    <%#Eval("Unit") %>
                                                                </td>
                                                                <td width="160px">
                                                                    <asp:TextBox ID="txtQuantity" runat="server" CssClass="field" />
                                                                </td>
                                                                <td width="10px">
                                                                    <asp:CheckBox ID="chk" runat="server" />
                                                                    <asp:HiddenField ID="hdf" runat="server" Value='<%#Eval("GraveID") %>' />
                                                                    <asp:HiddenField ID="hdfexpand" runat="server" Value="true" />
                                                                </td>
                                                            </tr>
                                                            <asp:Repeater ID="rptInsertGrave" runat="server" OnItemDataBound="rptInsertGrave_ItemDataBound">
                                                                <ItemTemplate>
                                                                    <tr>
                                                                        <td>
                                                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                                            <asp:ImageButton ID="imgButton" runat="server" OnClick="imgButton4_Click" />
                                                                            <%#Eval("GraveName") %>
                                                                        </td>
                                                                        <td>
                                                                            <%#Eval("UnitPrice") %>
                                                                        </td>
                                                                        <td>
                                                                            <%#Eval("Unit") %>
                                                                        </td>
                                                                        <td width="160px">
                                                                            <asp:TextBox ID="txtQuantity" runat="server" CssClass="field" />
                                                                        </td>
                                                                        <td width="10px">
                                                                            <asp:CheckBox ID="chk" runat="server" />
                                                                            <asp:HiddenField ID="hdf" runat="server" Value='<%#Eval("GraveID") %>' />
                                                                            <asp:HiddenField ID="hdfexpand" runat="server" Value="true" />
                                                                        </td>
                                                                    </tr>
                                                                </ItemTemplate>
                                                            </asp:Repeater>
                                                        </ItemTemplate>
                                                    </asp:Repeater>
                                                </ItemTemplate>
                                            </asp:Repeater>
                                        </ItemTemplate>
                                    </asp:Repeater>
                                </ItemTemplate>
                            </asp:Repeater>
                            <asp:Button ID="btnInsertGrave" runat="server" ValidationGroup="1" Text="Thêm mới"
                                CssClass="button" OnClick="btnInsertGrave_Click" />
                        </fieldset>
                    </asp:Panel>
                    <!--End pnlGraves-->
        </fieldset> </ContentTemplate> </asp:UpdatePanel>
        <fieldset class="box-content">
            <legend><b>Danh sách các hỗ trợ</b></legend>
            <fieldset class="box-content">
                <asp:HiddenField ID="hdfSupportMove" runat="server" />
                <legend><b>Hỗ trợ di chuyển</b></legend>
                <uc1:ucSupportMove ID="ucSupportMove1" runat="server" Visible="false" />
                <asp:Button ID="btnInsertSupportMove" runat="server" Text="Thêm mới" CssClass="button"
                    OnClick="btnInsertSupportMove_Click" />
            </fieldset>
            <fieldset class="box-content">
                <asp:HiddenField ID="hdfSupportRent" runat="server" />
                <legend><b>Hỗ trợ thuê nhà ở</b></legend>
                <uc2:ucSupportRent ID="ucSupportRent1" runat="server" Visible="false" />
                <asp:Button ID="btnInsertSupportRent" runat="server" Text="Thêm mới" CssClass="button"
                    OnClick="btnInsertSupportRent_Click" />
            </fieldset>
            <fieldset class="box-content">
                <asp:HiddenField ID="hdfSupportStabilize" runat="server" />
                <legend><b>Hỗ trợ ổn định đời sống</b></legend>
                <uc3:ucSupportStabilize ID="ucSupportStabilize1" runat="server" Visible="false" />
                <asp:Button ID="btnSupportStabilize" runat="server" Text="Thêm mới" CssClass="button"
                    OnClick="btnInsertSupportStabilize_Click" />
            </fieldset>
            <fieldset class="box-content">
                <asp:HiddenField ID="hdfSupportJob" runat="server" />
                <legend><b>Hỗ trợ việc làm</b></legend>
                <uc4:ucSupportJob ID="ucSupportJob1" runat="server" Visible="false" />
                <asp:Button ID="btnSupportJob" runat="server" Text="Thêm mới" CssClass="button" OnClick="btnInsertSupportJob_Click" />
            </fieldset>
            <fieldset class="box-content">
                <asp:HiddenField ID="hdfSupportOther" runat="server" />
                <legend><b>Hỗ trợ khác</b></legend>
                <asp:HiddenField ID="hdfModeNew" runat="server" Value="false" />
                <div id="SupportOther">
                    <div class="nr">
                        <input type="image" id="btnInsert" src="/Images/add-button.jpg" />
                    </div>
                    <div class="cl">
                    </div>
                    <table border="0" cellpadding="0" cellspacing="0" class="table" width="100%">
                        <tr>
                            <th>
                                Loại hỗ trợ
                            </th>
                            <th width="200px">
                                Số tiền
                            </th>
                            <th width="85px">
                                Chức năng
                            </th>
                        </tr>
                        <asp:Repeater ID="rptSuppportOther" runat="server" OnItemCommand="rptSuppportOther_ItemCommand">
                            <ItemTemplate>
                                <tr>
                                    <td>
                                        <%#Eval("SupportName") %>
                                    </td>
                                    <td>
                                        <%#Eval("UnitPrice") %>
                                    </td>
                                    <td>
                                        <asp:ImageButton runat="server" ImageUrl="~/Images/pen.png" CommandName="btnEdit"
                                            CommandArgument='<%#Eval("SupportOtherID") %>' />
                                        &nbsp;&nbsp;
                                        <asp:ImageButton runat="server" ImageUrl="~/Images/delete.png" CommandName="btnDelete"
                                            CommandArgument='<%#Eval("SupportOtherID") %>' OnClientClick="return confirm('Xác nhận hành động xóa?');" />
                                    </td>
                                </tr>
                            </ItemTemplate>
                        </asp:Repeater>
                    </table>
                </div>
            </fieldset>
        </fieldset>
        <!-- End pnl4-->
        <div style="text-align: center; margin: 8px 0px;">
            <asp:Button ID="btnOK" runat="server" CssClass="button" Text=" OK " OnClick="btnOK_Click"
                OnClientClick="return AppliesValues();" />
            &nbsp;
            <asp:Button ID="btnCancel" runat="server" CssClass="button" Text="Cancel" OnClick="btnCancel_Click"
                ValidationGroup="1" />
        </div>
        <div class="dialogForm box-content" title="Cập nhật thông tin" style="display: none;
            width: 400px;">
            <p>
                <span>Loại hỗ trợ</span>
                <asp:TextBox ID="txtSupportName" runat="server" CssClass="field" Style="width: 280px" />
            </p>
            <p>
                <span>Số tiền</span>
                <asp:TextBox ID="txtPrice" runat="server" CssClass="field" Style="width: 280px" />
            </p>
            <p>
                <span>
                    <asp:Button ID="btnUpdate" runat="server" Text="OK" CssClass="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only"
                        OnClick="btnUpdate_Click" ValidationGroup="1" />
                </span><span>
                    <input type="button" id="Button1" value="Cancel" class="ui-button ui-widget ui-state-default ui-corner-all ui-button-text-only" />
                </span>
            </p>
        </div>
    </div>
    <script type="text/javascript">
        function showdialog() {
            $('.dialogForm').dialog({
                modal: true,
                autoOpen: false,
                width: 470,
                close: function () {
                    allFields.val("").removeClass("ui-state-error");
                }
            });
            $(".dialogForm").parent().appendTo($("form:first"))
            $('.dialogForm').dialog('open');
            return false;
        }

        $(document).ready(function () {
            $('.dialogForm').dialog({
                modal: true,
                autoOpen: false,
                width: 470,
                close: function () {
                    allFields.val("").removeClass("ui-state-error");
                }
            });

            $('#btnInsert').click(function () {
                $('#<%=txtSupportName.ClientID %>').val("");
                $('#<%=txtPrice.ClientID %>').val("");
                $('#<%=hdfModeNew.ClientID %>').val('true');
                showdialog();
                return false;
            });

            $('#Button1').click(function () {
                $('.dialogForm').dialog('close');
            });
            $('#<%=btnUpdate.ClientID %>').click(function () {
                var values = $('#<%=txtSupportName.ClientID%>').val();
                if (values == null || values == '') return false;
                values = $('#<%=txtPrice.ClientID%>').val();
                if (values == null || values == '') return false;
                return true;
            });
        });
    </script>
</asp:Content>
